package com.huawei.appgallery.forum.forum.card;

import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.huawei.appgallery.forum.base.card.ForumCard;
import com.huawei.appgallery.forum.forum.bean.ForumHorizonCardBean;
import com.huawei.appgallery.forum.forum.widget.BounceHorizontalRecyclerView;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.List;
import o.azb;
import o.bum;
import o.bun.c;
import o.cgz;
import o.dof;
import o.eiy;

public class ForumHorizonCard extends ForumCard {
    private View ˊ;
    protected bum ˋ;
    protected BounceHorizontalRecyclerView ˏ;

    public ForumHorizonCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ʽ(view);
        azb.ˏ(view, c.ᐝˊ);
        this.ʿ = (TextView) view.findViewById(c.ˎˎ);
        this.ˊ = view.findViewById(c.ˌ);
        this.ˊ.setVisibility(8);
        ˎ(view);
        return this;
    }

    private void ˎ(View view) {
        this.ˏ = (BounceHorizontalRecyclerView) view.findViewById(c.ˊ);
        this.ˏ.setLayoutManager(new LinearLayoutManager(view.getContext(), 0, false));
        new eiy().ˏ(this.ˏ);
        this.ˋ = new bum(this.ʼॱ);
        this.ˏ.setAdapter(this.ˋ);
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ForumHorizonCardBean) {
            ForumHorizonCardBean forumHorizonCardBean = (ForumHorizonCardBean) cardBean;
            if (dof.ʽ(forumHorizonCardBean.v_())) {
                this.ʿ.setVisibility(4);
            } else {
                this.ʿ.setVisibility(0);
                this.ʿ.setText(forumHorizonCardBean.v_());
            }
            List ˊ = forumHorizonCardBean.ˊ();
            if (ˊ != null && ˊ.size() > 0) {
                this.ˋ.ˎ(ˊ);
            }
        }
    }

    public void ˎ(BaseCardBean baseCardBean) {
        super.ˎ(baseCardBean);
    }
}
